]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
util: Remove unused class CloseButton
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 2 Jun 2020 14:16:36 +0000 (16:16 +0200)
committerJonas Dreßler <verdre@v0yd.nl>
Thu, 11 Jun 2020 18:49:31 +0000 (20:49 +0200)
This looks like it was used to create the close buttons in the overview
at some point, we're no longer using it nowadays though, so remove it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298

js/misc/util.js

index c68604e87b15b3b4214308acb7c322012a5e6903..314d7660f6eb5145ed58b8e2307974b81bd5bbbb 100644 (file)
@@ -1,9 +1,9 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine,
             formatTime, formatTimeSpan, createTimeLabel, insertSorted,
-            makeCloseButton, ensureActorVisibleInScrollView, wiggle */
+            ensureActorVisibleInScrollView, wiggle */
 
-const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi;
+const { Clutter, Gio, GLib, Shell, St, GnomeDesktop } = imports.gi;
 const Gettext = imports.gettext;
 
 const Main = imports.ui.main;
@@ -363,51 +363,6 @@ function insertSorted(array, val, cmp) {
     return pos;
 }
 
-var CloseButton = GObject.registerClass(
-class CloseButton extends St.Button {
-    _init(boxpointer) {
-        super._init({
-            style_class: 'notification-close',
-            x_expand: true,
-            y_expand: true,
-            x_align: Clutter.ActorAlign.END,
-            y_align: Clutter.ActorAlign.START,
-        });
-
-        this._boxPointer = boxpointer;
-        if (boxpointer)
-            this._boxPointer.connect('arrow-side-changed', this._sync.bind(this));
-    }
-
-    _computeBoxPointerOffset() {
-        if (!this._boxPointer || !this._boxPointer.get_stage())
-            return 0;
-
-        let side = this._boxPointer.arrowSide;
-        if (side == St.Side.TOP)
-            return this._boxPointer.getArrowHeight();
-        else
-            return 0;
-    }
-
-    _sync() {
-        let themeNode = this.get_theme_node();
-
-        let offY = this._computeBoxPointerOffset();
-        this.translation_x = themeNode.get_length('-shell-close-overlap-x');
-        this.translation_y = themeNode.get_length('-shell-close-overlap-y') + offY;
-    }
-
-    vfunc_style_changed() {
-        this._sync();
-        super.vfunc_style_changed();
-    }
-});
-
-function makeCloseButton(boxpointer) {
-    return new CloseButton(boxpointer);
-}
-
 function ensureActorVisibleInScrollView(scrollView, actor) {
     let adjustment = scrollView.vscroll.adjustment;
     let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();